from django.views.generic import TemplateView, ListView, View
from django.conf import settings
from dashboard.models import Product


class ProductMonitorView(TemplateView):

    template_name = "monitor/product/product_monitor.html"

    def get_context_data(self, **kwargs):
        context = super(ProductMonitorView, self).get_context_data(**kwargs)
        context['products'] = Product.objects.filter(p_product__isnull=True)
        context['graphite_conf'] = settings.GRAPHITE_GLOBAL_CONF
        context['graphite_api'] = settings.GRAPHITE_API
        return context
